<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/include/head_common.html"> 
<#include "/include/tree_table.html">
<title>机构管理</title>
<script type="text/javascript">
$(document).ready(function() {
	//根据tr的pId进行treeTable的操作
	$("#treeTable").treeTable({
		expandLevel : 3
	}).show();
});
</script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="list">机构列表</a></li>
    <li><a href="edit">机构添加</a></li>
</ul>
<#include "/include/message.html">
<table id="treeTable" class="table table-striped table-bordered table-condensed ">
    <thead>
    	<tr>
        	<th>机构名称</th>
        	<th>操作</th>
        	<th>归属区域</th>
        	<th>机构编码</th>
        	<th>机构类型</th>
        	<th>是否可用</th>
        	<th>备注</th>
        </tr>
    </thead>
		<tbody>
			<#list list as office>
			<tr id="${office.id}" pId="${office.parentId!''}">
				<td><a href="edit?id=${office.id!''}">${office.name!''}</a></td>
				<td>
                	<a href="edit?id=${office.id!''}">修改</a>
                	<a href="delete?id=${office.id!''}"
                   		onclick="return confirmx('要删除该机构及所有子机构项吗？', this.href)">删除</a>
                	<a href="edit?parentId=${office.id!''}">添加下级机构</a>
            	</td>
				<td>${areaMap[office.areaId]}</td>
        		<td>${office.code!''}</td>
        		<td>${dictMap[office.type]}</td>
        		<td><#if office.useable=='1'>是<#else>否</#if></td>
        		<td>${office.remarks!''}</td>
			</tr>
			</#list>
		</tbody>
	</table>
</body>
</html>